<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('系统管理员操作界面')"/>
    <th:block th:include="include :: bootstrap-select-css"/>
    <link th:href="@{/ruoyi/css/jquery-confirm.min.css}" rel="stylesheet"/>
</head>
<body>
<div class="modal fade" id="fwqpzModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     data-backdrop="static"
     data-keyboard="false">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">服务器配置向导</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">驱动类</label>
                        <div class="col-sm-10">
                            <select name="sbbh_sel" id="sbbh_sel" class="form-control">
                            </select>
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">服务器</label>
                        <div class="col-sm-10">
                            <input type="text" name="loginName" class="form-control" id="fwq_input"
                                   placeholder="请输入服务器IP地址">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">用户名</label>
                        <div class="col-sm-10">
                            <input type="text" name="loginName" class="form-control" id="yhm_input"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">密&nbsp;&nbsp;码</label>
                        <div class="col-sm-10">
                            <input type="password" name="loginPassword" class="form-control" id="mm_input"
                                   placeholder="请输入密码">
                            <span class="help-block"></span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="emp_save_btn" onclick="login()">下一步</button>
            </div>
        </div>
    </div>
</div>
<h1>首页</h1>
</body>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-select-js"/>
<script th:src="@{/ruoyi/js/jquery-confirm.min.js}"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $.ajax({
            url: "/is_dat",
            type: "get",
            async: false,
            success: function (date) {
                if (date==true){
                    alert("有文件")
                    //登录
                } else {
                    //打开模态框，进行配置文件的设置
                    // $("#empAddModal").modal('hide');
                    getsblx("#sbbh_sel");
                    $("#fwqpzModal").modal({
                        backdrop: "static"
                    });
                }
            }
        })
    })

    function getsblx(ele) {
        $.ajax({
            url: '/sbgl/sjkmc/getsjkmc/',
            type: 'get',
            async: false,
            success: function (data) {
                $(ele).empty();
                var options = "";   //字符串拼接
                $(ele).append('<option value="">请选择数据库类型</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].driverClass + "'>" + data[i].sjkmc + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $(ele).append(options);
            }
        })
    }
</script>
</html>